package day09_Properties_topic8;

import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;

/*将题目一中 `iphone.properties`文件的数据加载到 Properties对中，并遍历打印出来。*/
public class PrintProperties {
    public static void main(String[] args) {
        //定义properties对象
        Properties properties = new Properties();
        //
        try {
            properties.load(new FileReader("src/iphone.properties"));
            for (String key : properties.stringPropertyNames()) {
                System.out.println(key + "=" + properties.getProperty(key));
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
